package org.orbis.spikezolt;

import java.io.IOException;

import org.anddev.andengine.audio.sound.Sound;
import org.anddev.andengine.audio.sound.SoundFactory;
import org.anddev.andengine.util.Debug;

public class SoundPlayer {
	public Sound snd_bounce, snd_portal, snd_powerup, snd_switch;

	public SoundPlayer(SpikeZoltActivity sa) {
		try {
			snd_bounce = SoundFactory.createSoundFromAsset(
					sa.mEngine.getSoundManager(), sa, "mfx/snd_bounce.ogg");
			snd_portal = SoundFactory.createSoundFromAsset(
					sa.mEngine.getSoundManager(), sa, "mfx/snd_portal.ogg");
			snd_powerup = SoundFactory.createSoundFromAsset(
					sa.mEngine.getSoundManager(), sa, "mfx/snd_powerup.ogg");
			snd_switch = SoundFactory.createSoundFromAsset(
					sa.mEngine.getSoundManager(), sa, "mfx/snd_switch.ogg");
		} catch (final IOException e) {
			Debug.e("Error loading sound file");
		}
	}

	public void sound_play(Sound snd) {
		snd.play();
	}

	public void sound_stop(Sound snd) {
		snd.stop();
	}
}
